package com.cyh.dao.impl;
import com.cyh.dao.UserDao;
import com.cyh.domain.User;

import java.util.List;
import java.util.Map;
import java.util.Properties;

public class UserDaoImpl implements UserDao{
    private String userName;
    private int age;

    private List<String> strList;
    private Map<String, User> userMap;
    private Properties properties;

    //必须有默认的无参构造 bean的第一种实例化方法

    //或者显示创建无参构造
    public UserDaoImpl(){
        System.out.println("UserDaoImpl创建....");
    }
    public void save(){
        System.out.println("save runimg...");
        System.out.println("username = " + userName + ", age = " + age);
        System.out.println("strList = " + strList);
        System.out.println("userMap = " + userMap);
        System.out.println("properties = " + properties);
    }

    public void init() {
        System.out.println("配置文件配置初始方法。。。");
    }

    public void destroy(){
        System.out.println("配置文件配置销毁方法。。。");
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setStrList(List<String> strList) {
        this.strList = strList;
    }

    public void setUserMap(Map<String, User> userMap) {
        this.userMap = userMap;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }
}